<html>
<head><meta charset="utf-8"><title>Any tips for faster recompiles? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html">Any tips for faster recompiles?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222960465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960465">(Jan 16 2021 at 05:00)</a>:</h4>
<p>I'm editing files in rustc_span, and I guess because it's a very central library (at the top of dependency tree) it takes forever to rebuild stage 1 compiler after editing. I'm using <code>./x.py build --stage 1</code>. Any tips?</p>



<a name="222960489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960489">(Jan 16 2021 at 05:01)</a>:</h4>
<p><span class="user-mention" data-user-id="119169">@osa1</span> do you have <code>incremental = true</code> in config.toml?</p>



<a name="222960516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960516">(Jan 16 2021 at 05:01)</a>:</h4>
<p>it takes me a while with incremental, but not more than maybe 5 minutes</p>



<a name="222960567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960567">(Jan 16 2021 at 05:02)</a>:</h4>
<p>That line is commented out:</p>
<div class="codehilite"><pre><span></span><code># Whether to always use incremental compilation when building rustc
#incremental = false
</code></pre></div>
<p>Should I enable this as <code>incremental = true</code>?</p>



<a name="222960572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960572">(Jan 16 2021 at 05:02)</a>:</h4>
<p>yes, it will be a <em>lot</em> faster</p>



<a name="222960612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960612">(Jan 16 2021 at 05:03)</a>:</h4>
<p>Thanks, just did that.</p>



<a name="222960970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222960970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222960970">(Jan 16 2021 at 05:12)</a>:</h4>
<p>you might want to consider setting <code>profile = "compiler"</code> at the top of config.toml, that has lots of other useful defaults</p>



<a name="222961010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222961010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222961010">(Jan 16 2021 at 05:12)</a>:</h4>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="err">&gt;</span> <span class="n">cat</span> <span class="n">src</span><span class="err">/</span><span class="n">bootstrap</span><span class="err">/</span><span class="n">defaults</span><span class="err">/</span><span class="n">config</span><span class="p">.</span><span class="n">compiler</span><span class="p">.</span><span class="n">toml</span>
<span class="c1"># These defaults are meant for contributors to the compiler who do not modify codegen or LLVM</span>
<span class="k">[rust]</span>
<span class="c1"># This enables `RUSTC_LOG=debug`, avoiding confusing situations</span>
<span class="c1"># where adding `debug!()` appears to do nothing.</span>
<span class="c1"># However, it makes running the compiler slightly slower.</span>
<span class="n">debug-logging</span> <span class="o">=</span> <span class="kc">true</span>
<span class="c1"># This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.</span>
<span class="n">incremental</span> <span class="o">=</span> <span class="kc">true</span>

<span class="k">[llvm]</span>
<span class="c1"># Will download LLVM from CI if available on your platform (Linux only for now)</span>
<span class="c1"># https://github.com/rust-lang/rust/issues/77084 tracks support for more platforms</span>
<span class="n">download-ci-llvm</span> <span class="o">=</span> <span class="s">"if-available"</span>
</code></pre></div>



<a name="222961484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Any%20tips%20for%20faster%20recompiles%3F/near/222961484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Any.20tips.20for.20faster.20recompiles.3F.html#222961484">(Jan 16 2021 at 05:25)</a>:</h4>
<p>Thanks. I already have the first two set manually. For the LLVM I'm using a local llvm-config so I'm not building it.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>